using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using vs.Authentication;
using vs.Core;


namespace Forum
{
    public partial class forum_admin : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Authenticate.IsAdmin)
                    Response.Redirect(UrlProvider.HomeUrl);

                if (!Page.IsPostBack)
                {
                    string modid = PortalUtils.CurrentModuleID;
                    ModSettingController db = new ModSettingController();
                    string forumdesk = db.Load(modid, "forumdesk");

                    lnkCatNew.NavigateUrl = UrlProvider.AdminUrl("fr_category", "edit");
                    engine_xml engine = new engine_xml();
                    XmlDocument doc = engine.AdminXML(forumdesk);
                    string template = ResolveUrl("~/desktops/forum/template/forum_admin.xsl") ;
                    CommonFunction.XMLTransform(xmlTransformer, template, doc);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

        }
    }
}